﻿
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using Model;
using MsDAL;
using System.ComponentModel;
using Components;

namespace ServiceHelper
{
    [DataObjectAttribute]
    public partial class Buy1a00Manager : Buy1a00Base
    {
        private static Buy1a00Manager _entity;

        public static Buy1a00Manager Entity
        {
            get
            {
                if (_entity == null)
                    _entity = new Buy1a00Manager();
                return _entity;
            }
        }


        #region 个人代码
        public string SaveData(Hashtable tb, string action, string usercode)
        {
            List<SqlApp> lst = new List<SqlApp>();

            Buy1a00 model = null;
            if ("A" == action)
            {
                model = new Buy1a00();
                CommonUtil.GetInstance.CopyProperties(tb, model);

                model.Usercode = Context.GetAppByUserCode(usercode);
                model.Listid = Sys0a60Manager.Entity.CreateSn("buy1a00_listid", usercode);

                lst.Add(this.Add(model));
            }
            else if ("M" == action)
            {
                model = this.GetModelById(Validation.ToString(tb["listid"]));

                CommonUtil.GetInstance.CopyProperties(tb, model);

                lst.Add(this.Update(model));
            }

            return CommonManager.Entity.SaveData(lst);
        }

        #endregion
    }
}



